package com.imooc.schedule.springboot;

import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
import org.springframework.stereotype.Component;

/**
 * @Author Tim
 * @Description:
 * @Version 1.0
 */
@Component
public class SpringBootJob implements SimpleJob {
    @Override
    public void execute(ShardingContext shardingContext) {
        int shardingTotalCount = shardingContext.getShardingTotalCount();
        int shardingItem = shardingContext.getShardingItem();
        String shardingParameter = shardingContext.getShardingParameter();
//        System.out.println(String.format("springboot--- > shardingTotalCount: %s, shardingItem: %s," +
//                " shardingParameter: %s, Thread:%s", shardingTotalCount, shardingItem, shardingParameter, Thread.currentThread().getId()));
    }
}
